package io;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws Exception{
        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oob = new ObjectOutputStream(fos);
        Person p = new Person();
        p.setName("zrj");
        p.setAge(18);
        p.setGender("女");
        p.setOtherInfo(new String[]{"xueligao","xinggehao","dafang","jishuhao"});

        oob.writeObject(p);
        System.out.println("写出完毕");

        oob.close();
    }
}
